package com.huawei.cloud.phone.management.infrastructure.db.mapper;

import com.huawei.cloud.phone.management.domain.phone.Phone;
import com.huawei.cloud.phone.management.domain.phone.PhoneStatus;
import com.huawei.cloud.phone.management.domain.phone.PhoneUseStatus;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PhoneMapper {

    List<Phone> getPhonesByServerIds(List<String> serverIds);

    List<Phone> getPhonesByPhoneIds(List<String> phoneIds);

    List<String> getServerIds(List<String> serverIds);

    List<String> getPhoneIds(List<String> phoneIds);

    void mergerPhones(List<Phone> phones);

    void deletePhonesByServerId(String serverId);

    List<Phone> getPhonesByStatus(@Param("status") PhoneStatus status, @Param("useStatus") PhoneUseStatus useStatus);

    int updatePhoneUseStatus(@Param("phoneId") String phoneId, @Param("useStatus") PhoneUseStatus useStatus);

    int updateUseStatus(@Param("useStatus") PhoneUseStatus useStatus, @Param("timeout") long timeout);
}
